<%@ Control Language="C#" CodeFile="CategoryBrowseById.ascx.cs" Inherits="CategoryBrowse_ascx" %>
<%--<div class="box">
    <h4>
        For Rent - Offer</h4>
    <ul>
        <li><a href="">1 bed</a></li>
        <li><a href="">1 bed</a></li>
        <li><a href="">1 bed</a></li>
        <li><a href="">1 bed</a></li>
        <li><a href="">1 bed</a></li>
        <li><a href="">1 bed</a></li>
        <li><a href="">1 bed</a></li>
    </ul>
    <div class="clear">
    </div>
</div>--%>
<div class="browse">
    <h3>
        Or Browse by category</h3>
    <asp:Repeater ID="TopCategoryList" runat="server" DataSourceID="TopCategoriesDS"
        OnItemDataBound="TopCategoryList_ItemDataBound" OnItemCommand="TopCategoryList_ItemCommand">
        <ItemTemplate>
            
             <asp:Panel ID="box" runat="server" CssClass="box">             
                <h4>
                    <%# Eval("Name") %>
                    <%--<asp:LinkButton ID="TopCategoryButton" runat="server" Text='<%# Eval("Name") %>'
                        CommandArgument='<%# Eval("Id") %>' />--%>
                </h4>
                <%--(<%# Eval("NumActiveAds") %>)--%>
                <asp:Repeater ID="NestedSubCategoryRepeater" runat="server" DataSourceID="NestedCategoryDS"
                    OnItemCommand="NestedSubCategoryRepeater_ItemCommand">
                    <HeaderTemplate>
                        <ul>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <li>
                            <asp:LinkButton ID="SubCategoryButton" runat="server" Text='<%# Eval("Name") %>'
                                CommandArgument='<%# Eval("Id") %>' />
                            (<%# Eval("NumActiveAds") %>)</li></ItemTemplate>
                    <FooterTemplate>
                        </ul></FooterTemplate>
                </asp:Repeater>
                <asp:ObjectDataSource ID="NestedCategoryDS" TypeName="AspNet.StarterKits.Classifieds.Web.CategoryCache"
                    SelectMethod="GetBrowseCategoriesByParentId" runat="server">
                    <SelectParameters>
                        <asp:Parameter Type="Int32" Name="parentCategoryId"></asp:Parameter>
                    </SelectParameters>
                </asp:ObjectDataSource>
                <div class="clear">
               </asp:Panel>    
            </div>
        </ItemTemplate>
    </asp:Repeater>
    <asp:ObjectDataSource ID="TopCategoriesDS" runat="server" TypeName="AspNet.StarterKits.Classifieds.Web.CategoryCache"
        SelectMethod="GetBrowseCategoriesByParentId" OldValuesParameterFormatString="original_{0}">
        <SelectParameters>
            <asp:Parameter DefaultValue="0" Name="parentCategoryId" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <div class="clear"></div>
</div>
